//
//  XHRNewViewController.m
//  BuDeJie
//
//  Created by haoran on 16/3/31.
//  Copyright © 2016年 xuhaoran. All rights reserved.
//

#import "XHRNewViewController.h"
#import "XHRSubTagViewController.h"

@interface XHRNewViewController ()

@end

@implementation XHRNewViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    //设置背景色
    self.view.backgroundColor = [UIColor purpleColor];

    //设置导航条内容
    [self setupNavBar];
}


#pragma mark ---- 设置导航条
-(void)setupNavBar{
    //左边
    UIBarButtonItem *leftItem = [UIBarButtonItem buttonItemWithImage:[UIImage imageNamed:@"MainTagSubIcon"] andWithHighlightImage:[UIImage imageNamed:@"MainTagSubIconClick"] addTarget:self andAction:@selector(subTag)];
    
    self.navigationItem.leftBarButtonItem = leftItem;
    
    //中间 titleView
    self.navigationItem.titleView =[[UIImageView alloc]initWithImage:[UIImage imageNamed:@"MainTitle"]];
    
}

//点击了订阅标签
-(void)subTag{

    //创建订阅标签控制器
    XHRSubTagViewController * vc = [[XHRSubTagViewController alloc]init];
    
    //跳转到订阅标签控制器
    [self.navigationController pushViewController:vc animated:YES];
}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
